/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.promotion;


import com.enation.app.javashop.client.promotion.FullDiscountGiftClient;
import com.enation.app.javashop.core.client.fallback.promotion.FullDiscountGiftClientFallbackFactory;
import com.enation.app.javashop.model.goods.enums.QuantityType;
import com.enation.app.javashop.model.promotion.fulldiscount.dos.FullDiscountGiftDO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author fk
 * @version v2.0
 * @Description: 满送赠品client
 * @date 2020/4/3 11:21
 * @since v7.2.0
 */
@FeignClient(name = "promotion-service", fallbackFactory = FullDiscountGiftClientFallbackFactory.class)
public interface FullDiscountGiftClientFeignImpl extends FullDiscountGiftClient {


    /**
     * 增加赠品库存
     * @param giftDOList
     * @return
     */
    @Override
    @RequestMapping(value = "/client/promotion/full-discount-gift/quantity/add", method = RequestMethod.POST)
    boolean addGiftQuantity(@RequestBody List<FullDiscountGiftDO> giftDOList);

    /**
     * 减少赠品库存
     * @param giftDOList
     * @param type
     * @return
     */
    @Override
    @RequestMapping(value = "/client/promotion/full-discount-gift/quantity/reduce", method = RequestMethod.POST)
    boolean reduceGiftQuantity(@RequestBody List<FullDiscountGiftDO> giftDOList, @RequestParam("type") QuantityType type);

    /**
     * 增加赠品可用库存
     * @param giftDOList
     * @return
     */
    @Override
    @RequestMapping(value = "/client/promotion/full-discount-gift/enable-quantity/add", method = RequestMethod.POST)
    boolean addGiftEnableQuantity(@RequestBody List<FullDiscountGiftDO> giftDOList);

    /**
     * 获取满优惠赠品
     * @param id 满优惠赠品主键
     * @return FullDiscountGift  满优惠赠品
     */
    @Override
    @RequestMapping(value = "/client/promotion/full-discount-gift/{id}", method = RequestMethod.GET)
    FullDiscountGiftDO getModel(@PathVariable("id") Long id);

}
